﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="com.mysql.jdbc.Driver" %>
<%@ page import="java.sql.*" %>
<%
request.setCharacterEncoding("UTF-8");

String userName="root";
String userPassword="";
String dbName="a0713225307";

String ID=request.getParameter("ID");

	Class.forName("com.mysql.jdbc.Driver").newInstance();
	String u="jdbc:mysql://localhost/"+dbName+"?user="+userName+"&password="+userPassword+"&useUnicode=true&characterEncoding=UTF-8";
	
	java.sql.Connection connection=java.sql.DriverManager.getConnection(u,userName,userPassword);
	String sql="select * from mywork_db where pId="+ID;
    Statement statement=connection.createStatement();
    ResultSet  rs=statement.executeQuery(sql);
	
	if(rs.next()){
%>

<!DOCTYPE html>
<html  lang="en">
<head>
<meta charset="utf-8"/>
<link rel="shortcut icon" href="../images/apple.ico" type="image/x-icon"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>我的手工展示</title>
<!--Main Stylesheet-->
<link rel="stylesheet" type="text/css" href="../css/style.css"/>
<link rel="stylesheet" href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css"/>  
<script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js"></script>

</head>


<body>

<!--主体-->
<div class="col-md-4" style="padding-top:100px;">
<img id="pic" src="<%=rs.getString(4)%>">
</div>

<div class="col-md-6"style="padding-top:100px;padding-bottom:50px;"id="info-box">
<div class="panel panel-default">
   <div class="panel-heading">
      <h3 class="panel-title">
         作品详情
      </h3>
   </div>
   <div class="panel-body">
      <table class="col-md-12">
	  <tr><td>名称：<%out.print(rs.getString(2));%></td><td>分类：<%out.print(rs.getString(3));%></td></tr>
	  <tr><td colspan="2">描述：<%out.print(rs.getString(5));%></td></tr>
	  </table>
   </div>
</div>
</div>

<div id="footer" style="position:fixed;bottom:0;background-color:black;width:100%;z-index:1000;">
    <div class="col-md-4 col-md-offset-4"style="color:white;">Copyright &copy; Rita.&nbsp; All Rights Reserved.</div>
</div> 
</body>
</html>


<%
	}
rs.close();
statement.close();
connection.close();
%>
